package com.danskin.wechat.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.danskin.wechat.dao.ProductGrouponDao;
import com.danskin.wechat.entity.ProductGroupon;
import com.danskin.wechat.service.ProductGrouponService;
import com.danskin.wechat.util.Page;
@Service
public class ProductGrouponServiceImpl implements ProductGrouponService{
	@Autowired
	private ProductGrouponDao productGrouponDao;
	@Override
	public void updateProductGroupon(ProductGroupon productGroupon) {
		// TODO Auto-generated method stub
		productGrouponDao.updateProductGroupon(productGroupon);
	}

	@Override
	public void saveProductGroupon(ProductGroupon productGroupon) {
		// TODO Auto-generated method stub
		productGrouponDao.saveProductGroupon(productGroupon);
	}

	@Override
	public List<ProductGroupon> queryProductGrouponSku(String sku, String type,int mpId) {
		// TODO Auto-generated method stub
		return productGrouponDao.queryProductGrouponSku(sku,type,mpId);
	}

	@Override
	public List<ProductGroupon> findProductGrouponListAPI(Page page, String sType) {
		Map<String, Object> map = page.getMap();
		map.put("categoryId", sType);
		// TODO Auto-generated method stub
		return productGrouponDao.listPagefindProductGrouponListAPI(page);
	}

	@Override
	public List<ProductGroupon> queryProductGrouponListIsHot(String appId) {
		// TODO Auto-generated method stub
		return productGrouponDao.queryProductGrouponListIsHot(appId);
	}

	@Override
	public ProductGroupon findProductGrouponDetails(String appId, String id) {
		// TODO Auto-generated method stub
		return productGrouponDao.findProductGrouponDetails(appId,id);
	}

	@Override
	public List<ProductGroupon> findProductGrouponList(Page page) {
		// TODO Auto-generated method stub
		return productGrouponDao.listPagefindProductGrouponList(page);
	}

	@Override
	public ProductGroupon findProductGrouponbyId(String id) {
		// TODO Auto-generated method stub
		return productGrouponDao.findProductGrouponbyId(id);
	}

	@Override
	public void deleteProductGrouponModel(String id) {
		// TODO Auto-generated method stub
		productGrouponDao.deleteProductGrouponModel(id);
	}

	@Override
	public List<ProductGroupon> queryProductGrouponAPIList(String appId, String name) {
		// TODO Auto-generated method stub
		return productGrouponDao.queryProductGrouponAPIList(appId,name);
	}

	@Override
	public ProductGroupon queryProductGrouponDetailedAPI(String appId, String id) {
		// TODO Auto-generated method stub
		return productGrouponDao.queryProductGrouponDetailedAPI(appId,id);
	}    
}
